function [myNum] = expression2num(expression)
    haycoma=0;
    myNum=0;
    multiplico = 1;
    termino=0;
    error=0;
    haycomaposta=0;
    
    if isempty(expression)
        myNum=-1;
        return
    end
    
    for k=1 :length(expression)
        if(expression(k)=='.')
            if (haycomaposta || haycoma)
                error=1;
            else
                haycomaposta=1;
            end
        else if((expression(k)=='M')||(expression(k)=='k')||(expression(k)=='m')||(expression(k)=='u')||(expression(k)=='n')||(expression(k)=='p'))
            if((haycoma)||(haycomaposta&&(~(length(expression)==k))))
                error=1;
                
            else
                haycoma=1;
            end 
            else
                if ~((expression(k)>='0') && (expression(k)<='9'))
                error=1;
                end
            end
        end
    end
    haycoma=0;
    
    if(~error)
        for k=1 :length(expression)
            if((str2double(expression(k))>= 0)&&(str2double(expression(k))<=9))
                if(haycoma)
                    myNum= myNum + str2double(expression(k))* 10^(haycoma-k);
                else
                    myNum=myNum*10;
                    myNum=myNum+str2double(expression(k));
                end

            else
                if(expression(k)=='.')
                    haycoma=k;
                else
                    if(expression(k)=='M')
                        multiplico=1000000;
                    end
                    if(expression(k)=='k')
                        multiplico=1000;
                    end
                    if(expression(k)=='m')
                        multiplico=0.001;
                    end
                    if(expression(k)=='u')
                        multiplico=0.000001;
                    end
                    if(expression(k)=='n')
                        multiplico=0.000000001;
                    end
                    if(expression(k)=='p')
                        multiplico=0.000000000001;
                    end

                    if(multiplico==1)
                        error=1;
                    end

                    if(~haycoma)
                        haycoma=k;
                    else
                        termino=1;
                    end

                end

                if(termino)
                    break;
                end

            end
        end
    end
    
    if(~error)
        myNum=myNum*multiplico;
    else
        myNum=-1;
    end

end